//
//  ClassCollectionViewCell.m
//  WXMusic
//
//  Created by 漫步人生路 on 15/9/2.
//  Copyright (c) 2015年 漫步人生路. All rights reserved.
//

#import "ClassCollectionViewCell.h"

@implementation ClassCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.classImageView = [[UIImageView alloc]initWithFrame:CGRectMake(15, 0, self.bounds.size.width - 30, self.bounds.size.height - 30)];
        self.className = [[UILabel alloc]initWithFrame:CGRectMake(0, self.classImageView.bounds.size.height + 5, self.bounds.size.width, self.classImageView.bounds.size.height/5)];
        self.layer.borderColor = [[UIColor whiteColor] CGColor];
        self.layer.borderWidth = 1;

        [self setUpClassName:self.className];
        [self.contentView addSubview:self.className];
        [self.contentView addSubview:self.classImageView];

    }
    return self;
}
- (void)setValueWithModel:(AllClassModel *)model
{
    [self.classImageView sd_setImageWithURL:[NSURL URLWithString:model.icon_ios]];
    self.className.text = model.scene_name;
}
- (void)setUpClassName:(UILabel *)className
{
    className.font = [UIFont boldSystemFontOfSize:17.0];
    className.textColor = [UIColor whiteColor];
    className.textAlignment = NSTextAlignmentCenter;
    
}
@end
